<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="hr">
<head>
    <title>Administracija</title>
</head>
<body>
    <?php if (Debug::isOn()): ?><pre style="border: 1px solid red; padding: 10px;"><?php Debug::_display('users'); ?></pre> <?php endif; ?>
    <h1>Administracija - korisnici</h1>

    <?php
    if (!empty($v['error_msg']))
    {
        echo '<p style="color: red;">' . $v['error_msg'] . '</p>';
    }
    ?>

    <table>
        <tr>
            <th>Id</th>
            <th>Email</th>
            <th>Ime</th>
            <th>Prezime</th>
            <th>Ban active</th>
            <th>Grupa</th>
            <th>Actions</th>
        </tr>
        <?php

        foreach ($v['users'] as $user)
        {
            echo '<tr>';
            echo '<td>' . $user['id'] . '</td>';
            echo '<td>' . $user['email'] . '</td>';
            echo '<td>' . $user['first_name'] . '</td>';
            echo '<td>' . $user['last_name'] . '</td>';
            echo '<td>' . (($user['on_line'] == 1) ? 'no' : 'yes') . '</td>';
            echo '<td>' . $user['user_level_name'] . '</td>';
            echo '<td><a href="/admin/user/edit?id=' . $user['id'] . '">Edit</a></td>';
            echo '</tr>';
        }

        ?>
    </table>
</body>
</html>
